package com.weijx.dishes.service.impl;
import com.weijx.dishes.entity.Product;
import com.weijx.dishes.mapper.ProductMapper;
import com.weijx.dishes.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
/**
 * com.weijx.dishes.service.impl.ProductServiceImpl
 * 描述：
 * on 2025/10/24-下午3:44
 *
 * @author weijx
 */


@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    private ProductMapper productMapper;

    @Override
    public List<Product> getAllProducts() {
        return productMapper.selectAllProducts();
    }

    @Override
    public List<Product> getProductsByCategoryId(String categoryId) {
        return productMapper.selectByCategoryId(categoryId);
    }

    @Override
    public Product getProductById(String id) {
        return productMapper.selectById(id);
    }
}
